package com.homedo.odin.solution.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.homedo.odin.solution.model.entity.AdServing;
import com.homedo.odin.solution.model.response.mng.adservings.MngAdServingsResponseBean;
import com.homedo.odin.solution.model.response.pc.AdServingsResponseBean;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.apache.ibatis.annotations.Param;

/**
 * <p> Mapper接口 </p>
 *
 * @author ZhangLei
 * @date 2018-05-15
 * @Description:
 */
public interface AdServingMapper extends BaseMapper<AdServing> {

    List<AdServing> selectByPositionCodeAndAdType(@Param("positionCode") String positionCode,@Param("adType")Integer adType);

    List<MngAdServingsResponseBean> selectListByShelveTimeOrderByTime(@Param("startDate") Date startDate,
            @Param("endDate") Date endDate);

    List<MngAdServingsResponseBean> selectAdvertisingListByShelveTimeOrderByTime(@Param("startDate") Date startDate,
            @Param("endDate") Date endDate,
            @Param("logShow") String logShow, @Param("logClick") String logClick,
            @Param("beforeDate") Date beforeDate, @Param("nowDate") Date nowDate);

    List<AdServingsResponseBean> selectByPositionCode(@Param("positionCodeList") Set<String> positionCodeList);

    List<AdServingsResponseBean> selectByPositionCodeAndUserLevel(@Param("positionCode") String positionCode,
            @Param("scoreLevel") Integer scoreLevel);

    /**
     * 定时投放当天未上架广告
     */
    void timingToAdvertise();

    /**
     * 下架当天已到期的投放广告
     */
    void shelvesAdvertise();

    AdServing selectByCreateTimeLimitOne();

}